/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.example.buffer;

import java.util.List;

import chunmap.example.BaseGeometryMap;
import chunmap.model.coord.Coordinate2D;
import chunmap.model.coord.Position;
import chunmap.model.elem.LineSegment;
import chunmap.model.geom.GeoPoint;
import chunmap.model.geom.Geometry;
import chunmap.model.operate.buffer.LineBuffer;
import chunmap.model.operate.buffer.PointBuffer;

/**
 * @author chunquedong
 * 
 */
public class SimpleBufferTest extends BaseGeometryMap {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SimpleBufferTest me = new SimpleBufferTest();
		me.init();
	}

	@Override
	protected void addGeometry(List<Geometry> geoms) {
		GeoPoint p = new GeoPoint(1, 1);
		PointBuffer pb = new PointBuffer();
		geoms.add(pb.createBuffer(p.getCoordinate(), 5));
		geoms.add(p);

		Position p1 = new Coordinate2D(-5, -5);
		Position p2 = new Coordinate2D(-10, -10);
		LineSegment lseg = new LineSegment(p1, p2);
		LineBuffer lb = new LineBuffer();
		geoms.add(lb.singleLineNoCapBuffer(lseg, 5));
		geoms.add(lseg.toLineString());
	}
}